package org.example.word.controller;

import org.example.word.service.IPdfService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * word控制器
 */
@RestController
@RequestMapping("/api/word")
public class WordController {

    @Resource
    private IPdfService pdfService;

    /**
     * 生成word
     * @param orderId
     * @param response
     * @throws Exception
     */
    @GetMapping("/generate")
    public void generatePdf(Long orderId, HttpServletResponse  response) throws Exception {
        pdfService.generatePdf(orderId, response);
    }
}
